package com.java.simple.study.juc.p5;

/**
 * @author zhoujunlin
 * @date 2022年06月27日 21:32
 * @desc
 */
public class AccountUnsafe implements Account {

    private Integer balance;

    public AccountUnsafe(Integer balance) {
        this.balance = balance;
    }

    @Override
    public Integer getBalance() {
        return balance;
    }

    @Override
    public void withdraw(Integer amount) {
        balance -= amount;
    }

    public static void main(String[] args) {
        Account.demo(new AccountUnsafe(10000));
        // 剩余:420 cost:133 ms
    }

}
